package com.sunyifeng.ch03;

public class Singleton3Hunger {

    // 创建静态的私有对象
    private static Singleton3Hunger instance = new Singleton3Hunger();

    // 私有让构造方法，这样该类就不会被实例化
    private Singleton3Hunger() {
    }

    //获取唯一可用的对象
    public static Singleton3Hunger getInstance() {
        return instance;
    }

    public void showMessage() {
        System.out.println("Hello World!");
    }
}
